package com.kavin.design.decorate;

/**
 * @author kavin
 * @Description 有彩铃的Phone
 * @create 2020/6/28
 **/
public class RingPhoneDecorate extends PhoneDecorate {


    RingPhoneDecorate(Phone p) {
        super(p);
    }

    //这里调用父类的call 方法。父类的call 方法是通过上面的构造方法赋值Phone的。也就是上面phone传的哪个类，就调用哪个类的call 方法
    @Override
    public void call(){
        System.out.println("手机可以听彩铃");
        super.call();
    }
}
